home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / IBM VisualAge for Java Enterprise v4.0 Retail / ivj40 / setup / IDE.Cab / F76515_GraphObject.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-04-25  |  2.6 KB  |  126 lines

  1. package com.ibm.ivb.dgraph;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Dimension;
  5. import java.awt.FontMetrics;
  6. import java.awt.Graphics;
  7. import java.awt.Point;
  8. import java.awt.Rectangle;
  9.  
  10. public abstract class GraphObject {
  11.    private static final String kCBIBMCopyright = "(c) Copyright IBM Corporation 1998";
  12.    public static final int SOLID = 0;
  13.    public static final int SOLID_3D = 1;
  14.    public static final int DASH = 2;
  15.    public static final int EMPTY = 3;
  16.    public static final int FILL = 4;
  17.    Object udata;
  18.    boolean visible = true;
  19.    boolean selected = false;
  20.    boolean opened = false;
  21.    int lineType = 0;
  22.    int fillType = 3;
  23.    Color color;
  24.    Color hcolor;
  25.    Rectangle rect;
  26.  
  27.    public GraphObject() {
  28.       this.color = Color.black;
  29.       this.hcolor = Color.red;
  30.       this.rect = new Rectangle();
  31.    }
  32.  
  33.    public abstract void calculateSize(FontMetrics var1, double var2);
  34.  
  35.    public boolean contains(int var1, int var2) {
  36.       return this.rect.contains(var1, var2);
  37.    }
  38.  
  39.    public boolean contains(Point var1) {
  40.       return this.rect.contains(var1);
  41.    }
  42.  
  43.    public Rectangle getBounds() {
  44.       return this.rect;
  45.    }
  46.  
  47.    public Color getColor() {
  48.       return this.color;
  49.    }
  50.  
  51.    public int getFillType() {
  52.       return this.fillType;
  53.    }
  54.  
  55.    public Color getHilightColor() {
  56.       return this.hcolor;
  57.    }
  58.  
  59.    public int getLineType() {
  60.       return this.lineType;
  61.    }
  62.  
  63.    public Point getLocation() {
  64.       return this.rect.getLocation();
  65.    }
  66.  
  67.    public Dimension getSize() {
  68.       return this.rect.getSize();
  69.    }
  70.  
  71.    public Object getUserData() {
  72.       return this.udata;
  73.    }
  74.  
  75.    public boolean isOpened() {
  76.       return this.opened;
  77.    }
  78.  
  79.    public boolean isSelected() {
  80.       return this.selected;
  81.    }
  82.  
  83.    public boolean isVisible() {
  84.       return this.visible;
  85.    }
  86.  
  87.    public abstract void paint(Graphics var1, FontMetrics var2, double var3);
  88.  
  89.    public void setColor(Color var1) {
  90.       this.color = var1;
  91.    }
  92.  
  93.    public void setFillType(int var1) {
  94.       this.fillType = var1;
  95.    }
  96.  
  97.    public void setHilightColor(Color var1) {
  98.       this.hcolor = var1;
  99.    }
  100.  
  101.    public void setLineType(int var1) {
  102.       this.lineType = var1;
  103.    }
  104.  
  105.    public void setLocation(int var1, int var2) {
  106.       this.rect.x = var1;
  107.       this.rect.y = var2;
  108.    }
  109.  
  110.    public void setOpened(boolean var1) {
  111.       this.opened = var1;
  112.    }
  113.  
  114.    public void setSelected(boolean var1) {
  115.       this.selected = var1;
  116.    }
  117.  
  118.    public void setUserData(Object var1) {
  119.       this.udata = var1;
  120.    }
  121.  
  122.    public void setVisible(boolean var1) {
  123.       this.visible = var1;
  124.    }
  125. }
  126.